Generally, an image encoder encodes image data by quantizing the image data, thereby generating encoded image data. At the time of quantizing image data, the image encoder uses a quantization coefficient. The larger the quantization coefficient is, the larger the encode rate is, and the larger a quantization error is. When the quantization error becomes large, the quality of a decoded image obtained by decoding the encoded image data deteriorates.
Conventionally, the image encoder encodes image data without consideration of a quantization error, so that deterioration in the quality of a decoded image cannot be prevented.